package com.fedorvlasov.lazylist;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ListView;

import com.hub.R;
/**
 * 
 * @author Lubwama Samuel
 *
 */
public class MainActivity extends Activity {
    
    ListView list;
    LazyAdapter adapter;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.category_unit);
        
        list=(ListView)findViewById(R.id.listViewAllunits);
        adapter=new LazyAdapter(this, mStrings,adapter.domainOrIp);
        list.setAdapter(adapter);
        
//        Button b=(Button)findViewById(R.id.button1);
//        b.setOnClickListener(listener);
    }
    
    @Override
    public void onDestroy(){
        list.setAdapter(null);
        super.onDestroy();
    }
    
    public OnClickListener listener=new OnClickListener(){
        @Override
        public void onClick(View arg0) {
            adapter.imageLoader.clearDiscCache();
            adapter.notifyDataSetChanged();
        }
    };
    
    private String[][] mStrings=new String[][] {
			{"http://10.0.2.2/login.jpg"},
			{"http://10.0.2.2/Doctor/images/House-Group1.jpg"},
			{"http://10.0.2.2/Doctor/images/dr.jpg"},
			{"http://10.0.2.2/Beauty/images/blog/01.jpg"},
			{"http://10.0.2.2/Beauty/images/blog/02.jpg"},
			{"http://10.0.2.2/Beauty/images/blog/03.jpg"},
			{"http://10.0.2.2/Beauty/images/blog/04.jpg"},
			{"http://10.0.2.2/Egina/images/Apartments/"},
			{"http://10.0.2.2/Egina/images/Apartments/220px-Nikon_D200_front_(aka).jpg"},
			{"http://10.0.2.2/Egina/images/Apartments/SonyA700_450w.jpg"},
			{"http://10.0.2.2/Egina/images/Apartments/Sony_T70_black_main.jpg"},
			{"http://10.0.2.2/Egina/images/Apartments/canon450d400d.jpg"},
			{"http://10.0.2.2/Egina/images/SMALL_IMAGE.jpg"}	
	};
}